import "./empty-sfc.css";
import { defineComponent, computed } from "vue";
import { createNamespace, transformStyleSize } from "../utils";
import FanImage from "../image/image.js";
const __vue_sfc__ = defineComponent({
  name: createNamespace("Empoty")[0],
  options: { virtualHost: true },
  components: { FanImage },
  props: {
    image: {
      type: String,
      default: "https://img.dac6.cn/fre/saas/empty-box.png"
    },
    imageSize: {
      type: [Number, String, Array],
      default: 100
    },
    messageStyle: [Object, String],
    message: {
      type: String,
      default: "\u6682\u65E0\u5185\u5BB9"
    },
    // 是否识别 \n 等
    pre: {
      type: Boolean,
      default: false
    }
  },
  setup(props) {
    const imageStyle = computed(() => {
      let style = props.imageSize;
      if (!Array.isArray(props.imageSize))
        style = [props.imageSize, props.imageSize];
      return style;
    });
    const msgStyle = computed(() => transformStyleSize(props.messageStyle));
    return {
      imageStyle,
      msgStyle
    };
  }
});
import { resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot, createElementVNode as _createElementVNode } from "vue";
const _hoisted_1 = { class: "fan-empty" };
const _hoisted_2 = { class: "fan-empty__bottom" };
function __vue_render__(_ctx, _cache) {
  const _component_FanImage = _resolveComponent("FanImage");
  return _openBlock(), _createElementBlock("div", _hoisted_1, [
    _createVNode(_component_FanImage, {
      src: _ctx.image,
      width: _ctx.imageStyle[0],
      height: _ctx.imageStyle[1]
    }, null, 8, ["src", "width", "height"]),
    _ctx.message ? (_openBlock(), _createElementBlock(
      "p",
      {
        key: 0,
        class: _normalizeClass(["fan-empty__msg", { pre: _ctx.pre }]),
        style: _normalizeStyle(_ctx.msgStyle)
      },
      _toDisplayString(_ctx.message),
      7
      /* TEXT, CLASS, STYLE */
    )) : _createCommentVNode("v-if", true),
    _createElementVNode("div", _hoisted_2, [
      _renderSlot(_ctx.$slots, "default")
    ])
  ]);
}
__vue_sfc__.render = __vue_render__;
var stdin_default = __vue_sfc__;
export {
  stdin_default as default
};
